home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / WIN / WINCALL.S < prev   
Text File  |  1994-12-20  |  2KB  |  118 lines

  1.     .text
  2.  
  3. //
  4. // os_version should the first system_call !!
  5. //
  6.     .align 2, 0x90
  7.     .globl    ___os_version
  8. ___os_version:
  9.     call    _rsxw32_init
  10.  
  11. /     movb     $0x30, %ah
  12. /     call     _dos21
  13.  
  14.     movw    $0x0050, %ax
  15.     ret
  16.  
  17. //
  18. // EAX =  31-fnct-16 , 0x7E , 7-count-0
  19. // EDX =  offset modulname  or 1,2,3
  20. // ECX =  paramlist
  21. //
  22. // ULONG _wincall(ULONG fnct, ULONG module, ULONG param, char count)
  23. //
  24.  
  25.     .align 2, 0x90
  26.     .globl __wincall
  27. __wincall:
  28.     pushl    %ebp
  29.     movl    %esp,%ebp
  30.     movl    8(%ebp), %eax
  31.     movl    12(%ebp), %edx
  32.     movl    16(%ebp), %ecx
  33.     shll    $16, %eax
  34.     movb    20(%ebp), %al
  35.     movb    $0x7E, %ah
  36.     pushl    %esi
  37.     pushl    %edi
  38.     pushl    %ebx
  39.     pushl    %ebp
  40.     call    ___syscall
  41.     popl    %ebp
  42.     popl    %ebx
  43.     popl    %edi
  44.     popl    %esi
  45.     leave
  46.     ret
  47.  
  48.  
  49. //
  50. //  call WinProc in EAX ; return to Extender
  51. //
  52.     .align 2, 0x90
  53.     .globl _wnd_dlg_proc32
  54. _wnd_dlg_proc32:
  55.     call    %eax
  56.     addl    $16, %esp
  57.     movw    __rsxw32_ds, %es
  58.     lret
  59.  
  60. //
  61. //  call WinProc in EAX ; return to Extender
  62. //
  63.     .align 2, 0x90
  64.     .globl _callb32_argc5
  65. _callb32_argc5:
  66.     call    %eax
  67.     addl    $5*4, %esp
  68.     movw    __rsxw32_ds, %es
  69.     lret
  70.  
  71.     .align 2, 0x90
  72.     .globl _callb32_argc4
  73. _callb32_argc4:
  74.     call    %eax
  75.     addl    $4*4, %esp
  76.     movw    __rsxw32_ds, %es
  77.     lret
  78.  
  79.     .align 2, 0x90
  80.     .globl _callb32_argc3
  81. _callb32_argc3:
  82.     call    %eax
  83.     addl    $3*4, %esp
  84.     movw    __rsxw32_ds, %es
  85.     lret
  86.  
  87.     .align 2, 0x90
  88.     .globl _callb32_argc2
  89. _callb32_argc2:
  90.     call    %eax
  91.     addl    $2*4, %esp
  92.     movw    __rsxw32_ds, %es
  93.     lret
  94.  
  95.  
  96. //
  97. //  call interrupts for 32bit program to Windows
  98. //
  99. //  problem: windows provides only '286 trapgate'
  100. //         high eip, esp not saved!
  101. //
  102.  
  103.     .align    2, 0x90
  104.     .globl _dpmi31
  105. _dpmi31:
  106.     pushl    %ebp
  107.     movl    %esp, %ebp
  108.  
  109. // windows kill high eip,esp
  110.     movl    $0x1000, %esp
  111.     movl    $0xc3c331cd, __text - 176
  112.     call    __text - 176
  113.  
  114.     movl    %ebp, %esp
  115.     pop    %ebp
  116.     ret
  117.  
  118.